import Vue from 'vue'
import Router from 'vue-router'
// import Home from './views/home/Home.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      meta: { title: '首页' },
      component: () => import('./views/home/Home.vue')
    },
    {
      path: '/cate',
      name: 'cate',
      meta: { title: '分类' },
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/cate/Cate.vue')
    },
    {
      path: '/login',
      name: 'login',
      meta: { title: '登录' },
      component: () => import(/* webpackChunkName: "about" */ './views/login/Login.vue')
    },
    {
      path: '/user',
      name: 'user',
      meta: { title: '会员中心' },
      component: () => import(/* webpackChunkName: "about" */ './views/user/User.vue')
    },
    {
      path: '/cart',
      name: 'cart',
      meta: { title: '购物车' },
      component: () => import(/* webpackChunkName: "about" */ './views/cart/Cart.vue')
    },
    {
      path: '/search',
      name: 'search',
      meta: { title: '搜索' },
      component: () => import(/* webpackChunkName: "about" */ './views/search/Search.vue')
    },
    {
      path: '/product/:id',
      name: 'product',
      meta: { title: '商品详情' },
      component: () => import(/* webpackChunkName: "about" */ './views/product/Product.vue')
    },
    {
      path: '/demo',
      name: 'demo',
      meta: { title: 'demo' },
      component: () => import(/* webpackChunkName: "about" */ './views/testpage/Demo.vue')
    },
    {
      path: '/info',
      name: 'info',
      meta: { title: 'demo' },
      component: () => import(/* webpackChunkName: "about" */ './views/testpage/Info.vue')
    }
  ]
})
